package org.bigdata.framework.core.protocol;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.bigdata.framework.core.model.DataHandling;




public interface IDataHandlingService {
	
	/*测试数据库连接*/
	boolean getConnectionTest(String url,String user,String password,String coding,String type);

	/**数据源导入*/
	//数据导入---分页
	List<DataHandling> getDataHandling(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	//数据导入---列表总数
	int getDataHandlingCount(HashMap<String, Object> queryParams);
	//数据导入---查询
	DataHandling findDataHandling(Integer id);
	//数据导入---查询全部
	List<DataHandling> getDataHandling();
	//数据导入---保存
	DataHandling saveDataHandling(DataHandling dataHandling);
	//数据导入---更新
	DataHandling editDataHandling(DataHandling dataHandling);
	//数据导入---删除
	void deleteDataHandling(DataHandling dataHandling);
	/**数据源导入end*/
	
	//获取数据库表
	List<Map<String,Object>>getTableName(String url, String user, String password,String coding, String type);
	//获取数据库
	List<Map<String,Object>>getDataBaseName(String url, String user, String password,String coding, String type);
	//获取数据库字段信息
	List<Map<String,Object>>getField(String url, String user, String password,String coding, String type,String tableName);
	
	//获取Excel的sheet名称
	List<Map<String,String>>getExcelSheetName(String inPath);
	//获取txt字段
	List<Map<String,String>>getTxtField(String inPath,String type,String rowRegex, String fieldRegex);
	//获取Excel字段
	List<Map<String,String>>getExcelField(String inPath,String sheetName);
	//获取json字段
	List<Map<String,String>>getJsonField(String inPath);
	//获取xml字段
	List<Map<String,String>>getXmlField(String inPath,String elementPath);
	
	//启动导入操作
	void importData(DataHandling dataHandling,int pagesize,int count,int pagenum) throws Exception;
	//启动导入操作,list为知识库查询到的数据
	void exportData(DataHandling dataHandling,List<Map<String,Object>>list) throws Exception;
	//获取数据源总数
	int getDataSourceCount(DataHandling dataHandling);
	//获取数据源总数
	int getStoreCount(String tableName) throws Exception;
	
	
	//知识库数据恢复
	void dataBackup(String classesEn,String allOrZeng,String path) throws Exception;
	//知识库数据恢复
	Map<String,String> dataRecovery(String classesEn,String path) throws Exception;
	
	
	int applicationUserAddBatch(String filePath,String sheetName,String type,String memberId) throws Exception;
}
